package shared.highcharts.config

import dataclass.data
import java.lang.{Double => JDouble}

sealed abstract class SeriesAny extends Product with Serializable

@data class SeriesBar(
                   name: Option[String],
                   data:Option[Seq[Double]]
                 ) extends SeriesAny

object SeriesBar {
  def apply(
             name: String = null,
             data: Seq[JDouble] = null,
           ) = new SeriesBar(
    Option(name),
    Option(data.map(x => x: Double)),
  )
}

@data class Venn(
                        name: Option[String],
                        data: Option[Seq[SeriesVennData]]
                      ) extends SeriesAny

object Venn {
  def apply(
             name: String = null,
             data: Seq[SeriesVennData] = null,
           ) = new Venn(
    Option(name),
    Option(data),
  )
}

@data class Boxplot(
                           name: Option[String],
                           data: Option[Seq[Seq[Double]]]
                         ) extends SeriesAny

object Boxplot {
  def apply(
             name: String = null,
             data:Seq[Seq[Double]]=null
           ) = new Boxplot(
    Option(name),
    Option(data),
  )
}

@data class Scatter(
                           name: Option[String],
                           color: Option[String],
                           marker: Option[Marker],
                           tooltip:Option[Tooltip]
                         ) extends SeriesAny

object Scatter {
  def apply(
             name: String = null,
             color:String=null,
             marker:Marker=null,
             tooltip:Tooltip=null,
           ) = new Scatter(
    Option(name),
    Option(color),
    Option(marker),
    Option(tooltip),
  )
}






